import config from "@/config"
import http from "@/utils/request"

export default {
	// 单位
	unit: {
		list: {
			url: `${config.API_URL}/unit/list.do`,
			name: "列表",
			post: async function(data, config = {}) {
				return await http.post(this.url, data, config);
			}
		},
		save: {
			url: `${config.API_URL}/unit/save.do`,
			name: "新增/修改",
			post: async function(data, config = {}) {
				return await http.post(this.url, data, config);
			}
		},
		delete: {
			url: `${config.API_URL}/unit/delete.do`,
			name: "删除",
			post: async function(data, config = {}) {
				return await http.post(this.url, data, config);
			}
		},
		info: {
			url: `${config.API_URL}/unit/get.do`,
			name: "删除",
			post: async function(data, config = {}) {
				return await http.post(this.url, data, config);
			}
		},
	},
	// 门店
	store: {
		config: {
			url: `${config.API_URL}/store/config.do`,
			name: "config",
			post: async function(data, config = {}) {
				return await http.post(this.url, data, config);
			}
		},
		map: {
			url: `${config.API_URL}/store/map.do`,
			name: "map",
			post: async function(data, config = {}) {
				return await http.post(this.url, data, config);
			}
		},
		list: {
			url: `${config.API_URL}/store/list.do`,
			name: "列表",
			post: async function(data, config = {}) {
				return await http.post(this.url, data, config);
			}
		},
		save: {
			url: `${config.API_URL}/store/save.do`,
			name: "新增/修改",
			post: async function(data, config = {}) {
				return await http.post(this.url, data, config);
			}
		},
		delete: {
			url: `${config.API_URL}/store/delete.do`,
			name: "删除",
			post: async function(data, config = {}) {
				return await http.post(this.url, data, config);
			}
		},
		info: {
			url: `${config.API_URL}/store/get.do`,
			name: "删除",
			post: async function(data, config = {}) {
				return await http.post(this.url, data, config);
			}
		},
		audit: {
			url: `${config.API_URL}/store/audit.do`,
			name: "审核",
			post: async function(data, config = {}) {
				return await http.post(this.url, data, config);
			}
		},
	},
}
